<?php
/**
 * Created by 784855684@qq.com.
 * Link: https://github.com/lichtung/wshore
 * User: linzh
 * Date: 6/30/17
 * Time: 3:30 PM
 */
declare(strict_types=1);


namespace application\module\admin\addon\sign\throws;

/**
 * Class SignExpireException 登录过期
 * @package application\module\admin\addon\sign\throws
 */
class SignExpireException extends SignException
{

    private static $_errorcode = [
        10001 => 'session miss uid', # session 中缺少 uid
        10002 => 'session empty and cookie empty', # session和cookie都为空
        10003 => 'session empty and cookie miss uid', # session为空并且cookie中缺少uid
        10004 => 'session empty and cookie invalid', # session为空 并且cookie验证失败(不合法)
        10005 => 'session empty and cookie expire', # session和cookie都为空
    ];

    public function __construct(int $code)
    {
        !headers_sent() and header('z-session:' . $code);
        parent::__construct(self::$_errorcode[$code]);
    }

}